import {reqGetSearch} from "../../api";

export default ({
    namespaced: true,
    state: {
        searchList: {}
    },
    mutations: {
        POSTSEARCHLIST(state, load) {
            state.searchList = load
        }
    },
    actions: {
        async postSearchList({commit}, load = {}) {
            let c = await reqGetSearch(load);
            console.log(c.data)
            if (c.code == 200) {
                commit('POSTSEARCHLIST', c.data)
            }
        }
    },
    getters: {
        goodList(state) {
            console.log(state)
            return state.searchList.goodsList || [];
        },
        trademarkList(state) {
            return state.searchList.trademarkList || [];
        },
        attrsList(state) {
            return state.searchList.attrsList || [];
        }
    }

})